package org.fanpeng.demo.design.mediator;

/**
 * className: DefaultSqlSessionFactory
 * Description:
 * date: 2021/9/10 15:13
 *
 * @author fanpeng
 * @version 1.0
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory{

    private final Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration.connection, configuration.mapperElement);
    }
}
